Skip to content

explicitly specify binary mode reading audio file #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BruceWilliams
Copy link

Old Ruby (1.8) assumes binary mode; newer Ruby does not. Explicitly
specify binary mode so the code works with newer Ruby.

Old Ruby (1.8) assumes binary mode; newer Ruby does not. Explicitly
specify binary mode so the code works with newer Ruby.
@kthill
Copy link

kthill commented Feb 7, 2014

Unfortunately you cannot specify mode in ruby 1.8 which we are currently locked down to on our servers. I've pushed a fix to this issue to the current repo which works on all versions.

@BruceWilliams
Copy link
Author

I'm not sure why that "allow access to unaltered server json" change added itself to this pull request - I'd rather have created another one for that change. Having said that - I would like access to the original server json from my Ruby code.

@kthill
Copy link

kthill commented Feb 7, 2014

The purpose of the codekits is to abstract away json/api and provide a standard interface. Thus if new json values are added then a bug would be opened to add support.

Can I ask what reason to have access to the orignal json versus explicit models?

@BruceWilliams
Copy link
Author

I'm probably recapping what you already know, but:

The HTML5 SDK exposes the the back-end web services relatively transparently to the browser javascript. They do this by going through a proxy server that the SDK also provides. In fact we provide three servers - Ruby, Java, and PHP. They should look identical from the perspective of the browser code in the SDK.

In order to ensure the data returned to the browser is exactly the same from each server, we can either write code to convert the codekit object model into JSON, and try to be very careful that our Ruby, Java, and PHP codes all construct the exact same JSON for their respective object models; or we can simply return the JSON that codekit received from the back-end service, which we know will be identical across the different servers.

It is also unnecessary work for the codekit to convert the JSON into an object model, and then have our SDK servers immediately convert it back into functionally equivalent JSON. It makes sense to provide some mechanism to get the raw server response from codekit; I'm entirely open to changing the mechanism, given the requirements above, if you have a better way to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants